﻿using Dora.Tools.Enums.AdminUser;
using Dora.Tools.Utility;
using System;
using System.Collections.Generic;
using System.Text;

namespace Dora.Services.AdminUser.Dto.ViewDto
{
    public class SystemInfoListDto
    {
        #region model

        /// <summary>
        /// Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 全局唯一Key
        /// </summary>
        public string SystemKey { get; set; }

        /// <summary>
        /// 系统类型;1Web项目2小程序3App
        /// </summary>
        public int SystemType { get; set; }

        /// <summary>
        /// 系统名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 系统中文缩写
        /// </summary>
        public string CnName { get; set; }

        /// <summary>
        /// 系统英文缩写
        /// </summary>
        public string EnName { get; set; }

        /// <summary>
        /// OssBucketName
        /// </summary>
        public string BucketName { get; set; }

        /// <summary>
        /// 图标
        /// </summary>
        public string Icon { get; set; }

        /// <summary>
        /// LogoUrl;用于导航页显示
        /// </summary>
        public string LogoUrl { get; set; }

        /// <summary>
        /// 前端端口
        /// </summary>
        public int FrontPort { get; set; }

        /// <summary>
        /// 开发环境地址
        /// </summary>
        public string DevUrl { get; set; }

        /// <summary>
        /// 测试环境地址
        /// </summary>
        public string TestUrl { get; set; }

        /// <summary>
        /// 预生产环境地址
        /// </summary>
        public string PreUrl { get; set; }

        /// <summary>
        /// 生产环境地址
        /// </summary>
        public string ProUrl { get; set; }

        /// <summary>
        /// 源码管理地址
        /// </summary>
        public string CodeUrl { get; set; }

        /// <summary>
        /// 负责人Ids;半角逗号分隔
        /// </summary>
        public string HeaderIds { get; set; }

        /// <summary>
        /// 负责人名称;全角逗号分隔
        /// </summary>
        public string HeaderNames { get; set; }

        /// <summary>
        /// 排序;倒序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        
        #endregion
        #region extend

        /// <summary>
        /// 系统模块列表
        /// </summary>
        public List<PermissionListDto> SubList { get; set; }
        /// <summary>
        /// 标识权限是否选中，选中表示用户有这个权限
        /// </summary>
        public bool IsSelected { get; set; }
        /// <summary>
        /// 权限类型
        /// </summary>
        public int PType { get; set; }

        /// <summary>
        /// 权限Key
        /// </summary>
        public string AuthKey
        {
            get
            {
                return Id.ToString();
            }
        }

        /// <summary>
        /// 系统类型文本
        /// </summary>
        public string SystemTypeText
        {
            get
            {
                return ((SystemInfoType)SystemType).ToDescription();
            }
        }
        #endregion
    }
}
